<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">

    <ui:define name="body">

        <h:messages globalOnly="true" styleClass="message"/>

        <h:form id="programGoalForm">

            <rich:panel>
                <f:facet name="header">#{messages['programgoal']}</f:facet>
                <s:decorate id="numberDecoration" template="layout/edit.xhtml">
                    <ui:define name="label">#{messages['number']}</ui:define>
                    <h:inputText id="number" required="true"
                                 value="#{programGoalHome.instance.number}"/>
                </s:decorate>
                <s:decorate id="descriptionDecoration" template="layout/edit.xhtml">
                    <ui:define name="label">#{messages['programgoal.description']}</ui:define>
                    <h:inputTextarea id="description" required="true"
                                     value="#{programGoalHome.instance.description}"
                                     rows="10" cols="50" />
                </s:decorate>
                <s:decorate id="languageDecoration" template="layout/edit.xhtml">
                    <ui:define name="label">#{messages['programgoal.language']}</ui:define>
                    <h:selectOneMenu id="programOfStudy" value="#{programGoalHome.instance.language}"
                                       required="true">
                        <s:selectItems var="_lang" value="#{loLanguageList}"
                                       noSelectionLabel="#{messages['selectmenuselect']}"
                                       label="#{_lang.code} - #{_lang.name}"/>
                        <s:convertEntity/>
                    </h:selectOneMenu>
                </s:decorate>

                <div style="clear:both"/>

            </rich:panel>

            <div class="actionButtons">
                <h:commandButton id="save"
                                 value="#{messages['button.save']}"
                                 action="#{programGoalHome.persist}"
                                 rendered="#{!programGoalHome.managed}"/>
                <h:commandButton id="update"
                                 value="#{messages['button.update']}"
                                 action="#{programGoalHome.update}"
                                 rendered="#{programGoalHome.managed}"/>
                <h:commandButton id="delete"
                                 value="#{messages['button.delete']}"
                                 action="#{programGoalHome.remove}"
                                 immediate="true"
                                 rendered="#{programGoalHome.managed}"/>
                <s:button propagation="end"
                          id="done"
                          value="#{messages['button.done']}"
                          view="/programGoalList.xhtml"/>
            </div>

        </h:form>

        <rich:dataTable value="#{programGoalHome.learningOutcomes}" var="learningOutcome"
                        rendered="#{not empty programGoalHome.learningOutcomes}"
                        rowClasses="rvgRowOne,rvgRowTwo"
                        id ="learningOutcomesTable">
            <h:column>
                <f:facet name="header">#{messages['number']}</f:facet>
                #{learningOutcome.number}
            </h:column>
            <h:column>
                <f:facet name="header">#{messages['learningoutcome.description']}</f:facet>
                #{learningOutcome.description}
            </h:column>
            <h:column>
                <f:facet name="header">#{messages['learningoutcome.assessement']}</f:facet>
                #{learningOutcome.assessementTool}
            </h:column>
            <h:column>
                <f:facet name="header">#{messages['learningoutcome.schedule']}</f:facet>
                #{learningOutcome.timeSchedule}
            </h:column>
        </rich:dataTable>

    </ui:define>

</ui:composition>